import { Job } from '../../../../types/job';

export default class CombatantJobSearch {
  static getJob(abilityId: number): Job | undefined {
    for (const [key, value] of Object.entries(CombatantJobSearch.abilities)) {
      if (value?.includes(abilityId))
        return key as keyof typeof CombatantJobSearch.abilities;
    }
  }

  static readonly abilityMatchRegex = /[a-fA-F0-9]{1,4}/i;

  static readonly abilities: { [job in Job]?: number[] } = {
    PLD: [
      12959,
      12961,
      12964,
      12967,
      12968,
      12969,
      12970,
      12971,
      12972,
      12973,
      12974,
      12975,
      12976,
      12978,
      12980,
      12981,
      12982,
      12983,
      12984,
      12985,
      12986,
      12987,
      12988,
      12989,
      12991,
      12992,
      12993,
      12994,
      12996,
      13000,
      13001,
      13006,
      14480,
      16457,
      16458,
      16459,
      16460,
      16461,
      17669,
      17671,
      17672,
      17691,
      17692,
      17693,
      17694,
      17866,
      18050,
      27,
      29,
      30,
      3538,
      3539,
      3540,
      3541,
      3542,
      4284,
      4285,
      4286,
      50207,
      50209,
      50246,
      50260,
      50261,
      50262,
      50263,
      50264,
      7382,
      7383,
      7384,
      7385,
      8746,
      8749,
      8750,
      8751,
      8752,
      8754,
      8755,
      8756,
    ],
    WAR: [
      16462,
      16463,
      16464,
      16465,
      17695,
      17696,
      17697,
      17698,
      17889,
      3549,
      3550,
      3551,
      3552,
      4289,
      4290,
      4291,
      49,
      50157,
      50218,
      50249,
      50265,
      50266,
      50267,
      50268,
      50269,
      51,
      52,
      7386,
      7387,
      7388,
      7389,
      8758,
      8761,
      8762,
      8763,
      8764,
      8765,
      8767,
      8768,
    ],
    DRK: [
      16466,
      16467,
      16468,
      16469,
      16470,
      16471,
      16472,
      17700,
      17701,
      17702,
      3617,
      3621,
      3623,
      3624,
      3625,
      3629,
      3632,
      3634,
      3636,
      3638,
      3639,
      3640,
      3641,
      3643,
      4303,
      4304,
      4305,
      4306,
      4307,
      4308,
      4309,
      4310,
      4311,
      4312,
      4680,
      50158,
      50159,
      50271,
      50272,
      50319,
      7390,
      7391,
      7392,
      7393,
      8769,
      8772,
      8773,
      8775,
      8776,
      8777,
      8778,
      8779,
    ],
    GNB: [
      17703,
      17704,
      17705,
      17706,
      17707,
      17708,
      17709,
      17710,
      17711,
      17712,
      17713,
      17714,
      17716,
      17717,
      17890,
      17891,
      16137,
      50320,
      16138,
      16139,
      16140,
      16141,
      16142,
      16143,
      16144,
      16145,
      16162,
      50257,
      16148,
      16149,
      16151,
      16152,
      50258,
      16153,
      16154,
      16146,
      16147,
      16150,
      16159,
      16160,
      16161,
      16155,
      16156,
      16157,
      16158,
      16163,
      16164,
      16165,
      50259,
    ],
    WHM: [
      12958,
      12962,
      12965,
      12997,
      13002,
      13003,
      13004,
      13005,
      131,
      136,
      137,
      139,
      140,
      14481,
      1584,
      16531,
      16532,
      16533,
      16534,
      16535,
      16536,
      17688,
      17689,
      17690,
      17789,
      17790,
      17791,
      17793,
      17794,
      17832,
      3568,
      3569,
      3570,
      3571,
      4296,
      4297,
      50181,
      50182,
      50196,
      50307,
      50308,
      50309,
      50310,
      7430,
      7431,
      7432,
      7433,
      8895,
      8896,
      8900,
      9621,
      127,
      133,
    ],
    SCH: [
      16537,
      16538,
      16539,
      16540,
      16541,
      16542,
      16543,
      16544,
      16545,
      16546,
      16547,
      16548,
      16550,
      16551,
      166,
      167,
      17215,
      17216,
      17795,
      17796,
      17797,
      17798,
      17802,
      17864,
      17865,
      17869,
      17870,
      17990,
      185,
      186,
      188,
      189,
      190,
      3583,
      3584,
      3585,
      3586,
      3587,
      4300,
      50184,
      50214,
      50311,
      50312,
      50313,
      50324,
      7434,
      7435,
      7436,
      7437,
      7438,
      7869,
      802,
      803,
      805,
      8904,
      8905,
      8909,
      9622,
    ],
    AST: [
      10027,
      10028,
      10029,
      16552,
      16553,
      16554,
      16555,
      16556,
      16557,
      16558,
      16559,
      17055,
      17151,
      17152,
      17804,
      17805,
      17806,
      17807,
      17809,
      17991,
      3590,
      3593,
      3594,
      3595,
      3596,
      3598,
      3599,
      3600,
      3601,
      3603,
      3604,
      3605,
      3606,
      3608,
      3610,
      3612,
      3613,
      3614,
      3615,
      4301,
      4302,
      4401,
      4402,
      4403,
      4404,
      4405,
      4406,
      4677,
      4678,
      4679,
      50122,
      50124,
      50125,
      50186,
      50187,
      50188,
      50189,
      50314,
      50315,
      50316,
      7439,
      7440,
      7441,
      7442,
      7443,
      7444,
      7445,
      7448,
      8324,
      8913,
      8914,
      8916,
      9629,
    ],
    MNK: [
      12960,
      12963,
      12966,
      12977,
      12979,
      12990,
      12995,
      12998,
      12999,
      14476,
      14478,
      16473,
      16474,
      16475,
      16476,
      17674,
      17675,
      17676,
      17677,
      17719,
      17720,
      17721,
      17722,
      17723,
      17724,
      17725,
      17726,
      3543,
      3545,
      3546,
      3547,
      4262,
      4287,
      4288,
      50160,
      50161,
      50245,
      50273,
      50274,
      63,
      70,
      71,
      7394,
      7395,
      7396,
      74,
      8780,
      8781,
      8782,
      8783,
      8784,
      8785,
      8787,
      8789,
      8925,
    ],
    DRG: [
      16477,
      16478,
      16479,
      16480,
      17728,
      17729,
      3553,
      3554,
      3555,
      3556,
      3557,
      4292,
      4293,
      50162,
      50163,
      50247,
      50275,
      50276,
      7397,
      7398,
      7399,
      7400,
      86,
      8791,
      8792,
      8793,
      8794,
      8795,
      8796,
      8797,
      8798,
      8799,
      8802,
      8803,
      8804,
      8805,
      8806,
      92,
      94,
      95,
      96,
      9640,
      75,
      78,
    ],
    NIN: [
      16488,
      16489,
      16491,
      16492,
      16493,
      17413,
      17414,
      17415,
      17416,
      17417,
      17418,
      17419,
      17420,
      17732,
      17733,
      17734,
      17735,
      17736,
      17737,
      17738,
      17739,
      2246,
      2259,
      2260,
      2261,
      2262,
      2263,
      2264,
      2265,
      2266,
      2267,
      2268,
      2269,
      2270,
      2271,
      2272,
      3563,
      3566,
      4295,
      50165,
      50166,
      50167,
      50250,
      50279,
      50280,
      7401,
      7402,
      7403,
      8807,
      8808,
      8809,
      8810,
      8812,
      8814,
      8815,
      8816,
      8820,
      9461,
    ],
    SAM: [
      16481,
      16482,
      16483,
      16484,
      16485,
      16486,
      16487,
      17740,
      17741,
      17742,
      17743,
      17744,
      50208,
      50215,
      50277,
      50278,
      7477,
      7478,
      7479,
      7480,
      7481,
      7482,
      7483,
      7484,
      7485,
      7486,
      7487,
      7488,
      7489,
      7490,
      7491,
      7492,
      7493,
      7494,
      7495,
      7496,
      7497,
      7498,
      7499,
      7501,
      7502,
      7855,
      7857,
      7867,
      8821,
      8822,
      8823,
      8824,
      8825,
      8826,
      8828,
      8829,
      8830,
      8831,
      8833,
    ],
    BRD: [
      10023,
      114,
      116,
      117,
      118,
      13007,
      14479,
      16494,
      16495,
      16496,
      17678,
      17679,
      17680,
      17681,
      17682,
      17745,
      17747,
      3558,
      3559,
      3560,
      3561,
      3562,
      4294,
      50168,
      50169,
      50282,
      50283,
      50284,
      50285,
      50286,
      50287,
      7404,
      7405,
      7406,
      7407,
      7408,
      7409,
      8836,
      8837,
      8838,
      8839,
      8841,
      8842,
      8843,
      8844,
      9625,
      106,
    ],
    MCH: [
      16497,
      16498,
      16499,
      16500,
      16501,
      16502,
      16503,
      16504,
      16766,
      16889,
      17206,
      17209,
      17749,
      17750,
      17751,
      17752,
      17753,
      17754,
      2864,
      2866,
      2868,
      2870,
      2872,
      2873,
      2874,
      2876,
      2878,
      2890,
      4276,
      4675,
      4676,
      50117,
      50119,
      50288,
      50289,
      50290,
      50291,
      50292,
      50293,
      50294,
      7410,
      7411,
      7412,
      7413,
      7414,
      7415,
      7416,
      7418,
      8848,
      8849,
      8850,
      8851,
      8853,
      8855,
    ],
    DNC: [
      17756,
      17757,
      17758,
      17759,
      17760,
      17761,
      17762,
      17763,
      17764,
      17765,
      17766,
      17767,
      17768,
      17769,
      17770,
      17771,
      17772,
      17773,
      17824,
      17825,
      17826,
      17827,
      17828,
      17829,
      18076,
      15989,
      15990,
      15993,
      15997,
      15999,
      16000,
      16001,
      16002,
      16003,
      16191,
      16192,
      15991,
      15994,
      16007,
      50252,
      15995,
      15992,
      15996,
      16008,
      16010,
      50251,
      16015,
      16012,
      16006,
      18073,
      50253,
      16011,
      16009,
      50254,
      15998,
      16004,
      16193,
      16194,
      16195,
      16196,
      16013,
      16005,
      50255,
      50256,
      16014,
    ],
    BLM: [
      14477,
      153,
      154,
      158,
      159,
      162,
      16505,
      16506,
      16507,
      17683,
      17684,
      17685,
      17686,
      17687,
      17774,
      17775,
      3573,
      3574,
      3575,
      3576,
      3577,
      4298,
      50171,
      50172,
      50173,
      50174,
      50295,
      50296,
      50297,
      50321,
      50322,
      7419,
      7420,
      7421,
      7422,
      8858,
      8859,
      8860,
      8861,
      8862,
      8863,
      8864,
      8865,
      8866,
      8867,
      8869,
      9637,
      149,
      155,
      141,
      152,
    ],
    SMN: [
      16510,
      16511,
      16513,
      16514,
      16515,
      16516,
      16517,
      16518,
      16519,
      16522,
      16523,
      16549,
      16795,
      16796,
      16797,
      16798,
      16799,
      16800,
      16801,
      16802,
      16803,
      17777,
      17778,
      17779,
      17780,
      17781,
      17782,
      17783,
      17784,
      17785,
      180,
      184,
      3578,
      3579,
      3580,
      3581,
      3582,
      4299,
      50176,
      50177,
      50178,
      50213,
      50217,
      50298,
      50299,
      50300,
      50301,
      50302,
      7423,
      7424,
      7425,
      7426,
      7427,
      7428,
      7429,
      7449,
      7450,
      787,
      788,
      791,
      792,
      794,
      796,
      797,
      798,
      800,
      801,
      8872,
      8873,
      8874,
      8877,
      8878,
      8879,
      8880,
      8881,
      9014,
      9432,
    ],
    RDM: [
      10025,
      16524,
      16525,
      16526,
      16527,
      16528,
      16529,
      16530,
      17786,
      17787,
      17788,
      50195,
      50200,
      50201,
      50216,
      50303,
      50304,
      50305,
      50306,
      7503,
      7504,
      7505,
      7506,
      7507,
      7509,
      7510,
      7511,
      7512,
      7513,
      7514,
      7515,
      7516,
      7517,
      7518,
      7519,
      7520,
      7521,
      7523,
      7524,
      7525,
      7526,
      7527,
      7528,
      7529,
      7530,
      8882,
      8883,
      8884,
      8885,
      8887,
      8888,
      8889,
      8890,
      8891,
      8892,
      9433,
      9434,
    ],
    BLU: [
      11715,
      11383,
      11384,
      11385,
      11386,
      11387,
      11388,
      11389,
      11390,
      11391,
      11392,
      11393,
      11394,
      11395,
      11396,
      11397,
      11398,
      11399,
      11400,
      11401,
      11402,
      11403,
      11404,
      11405,
      11406,
      11407,
      11408,
      11409,
      11410,
      11411,
      11412,
      11413,
      11414,
      11415,
      11416,
      11417,
      11418,
      11419,
      11420,
      11421,
      11422,
      11423,
      11424,
      11425,
      11426,
      11427,
      11428,
      11429,
      11430,
      11431,
      50219,
      50220,
      50221,
      50222,
      50223,
      50224,
    ],
  };
}
